import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/education/get_user_info_entity.dart';

GetUserInfoEntity $GetUserInfoEntityFromJson(Map<String, dynamic> json) {
  final GetUserInfoEntity getUserInfoEntity = GetUserInfoEntity();
  final String? areaCode = jsonConvert.convert<String>(json['areaCode']);
  if (areaCode != null) {
    getUserInfoEntity.areaCode = areaCode;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    getUserInfoEntity.companyCode = companyCode;
  }
  final String? departmentId = jsonConvert.convert<String>(json['departmentId']);
  if (departmentId != null) {
    getUserInfoEntity.departmentId = departmentId;
  }
  final int? isViewAll = jsonConvert.convert<int>(json['isViewAll']);
  if (isViewAll != null) {
    getUserInfoEntity.isViewAll = isViewAll;
  }
  final String? mobile = jsonConvert.convert<String>(json['mobile']);
  if (mobile != null) {
    getUserInfoEntity.mobile = mobile;
  }
  final String? nickname = jsonConvert.convert<String>(json['nickname']);
  if (nickname != null) {
    getUserInfoEntity.nickname = nickname;
  }
  final String? otherUid = jsonConvert.convert<String>(json['otherUid']);
  if (otherUid != null) {
    getUserInfoEntity.otherUid = otherUid;
  }
  final int? type = jsonConvert.convert<int>(json['type']);
  if (type != null) {
    getUserInfoEntity.type = type;
  }
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    getUserInfoEntity.userId = userId;
  }
  final String? username = jsonConvert.convert<String>(json['username']);
  if (username != null) {
    getUserInfoEntity.username = username;
  }
  return getUserInfoEntity;
}

Map<String, dynamic> $GetUserInfoEntityToJson(GetUserInfoEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['areaCode'] = entity.areaCode;
  data['companyCode'] = entity.companyCode;
  data['departmentId'] = entity.departmentId;
  data['isViewAll'] = entity.isViewAll;
  data['mobile'] = entity.mobile;
  data['nickname'] = entity.nickname;
  data['otherUid'] = entity.otherUid;
  data['type'] = entity.type;
  data['userId'] = entity.userId;
  data['username'] = entity.username;
  return data;
}

extension GetUserInfoEntityExtension on GetUserInfoEntity {
  GetUserInfoEntity copyWith({
    String? areaCode,
    String? companyCode,
    String? departmentId,
    int? isViewAll,
    String? mobile,
    String? nickname,
    String? otherUid,
    int? type,
    String? userId,
    String? username,
  }) {
    return GetUserInfoEntity()
      ..areaCode = areaCode ?? this.areaCode
      ..companyCode = companyCode ?? this.companyCode
      ..departmentId = departmentId ?? this.departmentId
      ..isViewAll = isViewAll ?? this.isViewAll
      ..mobile = mobile ?? this.mobile
      ..nickname = nickname ?? this.nickname
      ..otherUid = otherUid ?? this.otherUid
      ..type = type ?? this.type
      ..userId = userId ?? this.userId
      ..username = username ?? this.username;
  }
}
